home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / spmate13.zip / SPELLAPP.PA$ / spellapp.pas
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  58 lines

  1. {************************************************}
  2. {                                                }
  3. {   Demo program                                 }
  4. {   Copyright (c) 1991 by Borland International  }
  5. {                                                }
  6. {************************************************}
  7.  
  8. program SpellApp;
  9.  
  10. uses WinTypes, WinProcs, OWindows, ODialogs, SpellWnds;
  11.  
  12. type
  13.  
  14.   { Declare TFileApp, a TApplication descendant }
  15.   TFileApp = object(TApplication)
  16.     procedure InitMainWindow; virtual;
  17.     procedure InitInstance;  virtual;
  18.   end;
  19.  
  20.   { Declare TMyFileWindow, a TFileWindow descendant }
  21.   PMyFileWindow = ^TMyFileWindow;
  22.   TMyFileWindow = object(TFileWindow)
  23.     constructor Init(AParent: PWindowsObject; ATitle: PChar);
  24.   end;
  25.  
  26. { Construct a TMyFileWindow, loading its menu }
  27. constructor TMyFileWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  28. begin
  29.   TFileWindow.Init(AParent, ATitle, nil);
  30.   Attr.Menu := LoadMenu(HInstance, 'FileCommands');
  31. end;
  32.  
  33. { Construct the TFileApp's MainWindow of type TMyEditWindow }
  34. procedure TFileApp.InitMainWindow;
  35. begin
  36.   MainWindow := new(PMyFileWindow, Init(nil, 'Editor Spell Checker'));
  37. end;
  38.  
  39. { Initialize each MS-Windows application instance, loading an
  40.   accelerator table }
  41. procedure TFileApp.InitInstance;
  42. begin
  43.   TApplication.InitInstance;
  44.   if Status = 0 then
  45.     HAccTable := LoadAccelerators(HInstance, 'FileCommands');
  46. end;
  47.  
  48. { Declare a variable of type TFileApp }
  49. var
  50.   FileApp: TFileApp;
  51.  
  52. { Run the FileApp }
  53. begin
  54.   FileApp.Init('FileApp');
  55.   FileApp.Run;
  56.   FileApp.Done;
  57. end.
  58.